<?php
declare (strict_types=1);

namespace app\controller;

//use app\middleware\Auth;

class AuthAlias
{
//    protected $middleware = [
//        Auth::class . ':admin' 	=> ['except' 	=> ['hello'] ],
//        'Hello' => ['only' 		=> ['hello'] ],
//    ];

    // 别名加载
//    protected $middleware = ['auth'];

    protected $middleware = [
        'auth' 	=> ['except' 	=> ['hello'] ],
        'check' => ['only' 		=> ['hello'] ],
        'hello' => ['only' 		=> ['getHello'] ],
    ];

    public function index()
    {
        return 'index';
    }

    public function hello()
    {
        return 'hello';
    }

    public function getHello(){
        return request()->hello; // ThinkPHP
    }
}